package com.gotokeep.keep.composition;

/**
 * Source in render chain. It generate frames or audio data chunk after call {@link #renderFrame()}.
 *
 *
 * @author xana/cuixianming
 * @version 1.0
 * @since 2018/5/4 22:45
 */
public interface RenderSource {
    /**
     * Prepare render source. If success this can render frames until {@link #isEnd()} return true
     * or throw error.
     *
     * @return true if prepare success
     */
    boolean prepare();

    void prepareFrame(long presentationTimeUs);

    void renderFrame();

    void reset();

    void release();

    void seekTo(long timeUs);

    boolean isEnd();
}
